#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

// 2410. 运动员和训练师的最大匹配数
// https://leetcode.cn/problems/maximum-matching-of-players-with-trainers/description/?envType=daily-question&envId=2025-07-13

class Solution
{
public:
    int matchPlayersAndTrainers(vector<int> &players, vector<int> &trainers)
    {
        int n = players.size();
        int m = trainers.size();
        sort(players.begin(), players.end());
        sort(trainers.begin(), trainers.end());

        int ans = 0;
        int left = 0;
        for (int i = 0; i < n && left < m; )
        {
            if(players[i] <= trainers[left]){
                i++;
                ans++;
                left++;
            }else{
                left++;
            }
        }
        return ans;
    }
};

int main()
{
    return 0;
}